package main

import (
    "fmt"
    "time"
)

func main() {
    ch := make(chan int)

    go func() {
        for i := 0; i < 10; i++ {
            fmt.Printf("sending %d\n", i)
            ch <- i
        }
    }()

    for i := 0; i < 10; i++ {
        fmt.Printf("recving %dth num:", i)
        x := <-ch
        fmt.Printf("%d\n", x)
        time.Sleep(time.Second * 5)
    }
}
